xlv.obj.viewerMap={
	extend:function(){
		this.extend('xlv.obj.viewer');
	},
	implement:function(){
	},
	create:function(tag){
		var div=document.createElement((tag||'div'));
		div.setAttribute('xlvobject','xlv.obj.viewerMap');
		return div;			
	},
	properties:{
		dmName:null,
		dmPath:null,
		dmTextPath:null
	},
	method:{
		initial:function(){
			this.$super('xlv.obj.viewer.initial');
		},
		/**mvc imp*/
		mvc_valueToModel:function(value,dm){
			if(this.mvc_isModel(dm)) {
				dm.setValue(value,this.$P.dmPath);
				var editor=this.$P.editor;
				if(this.$P.dmTextPath&&editor&&editor.properties){
					var p=editor.properties;
					if(p.lookupdmName&&p.lookupdmPath&&p.lookupdmTextPath){
						var lpdm=this.mvc_getModel(p.lookupdmName);
						var text=(lpdm)?dm.map(p.lookupdmPath,value,p.lookupdmTextPath):'';
						dm.setValue(value,this.$P.dmTextPath);
					}
				}
			}
		},
		mvc_valueToView:function(value){
			var dm=this.mvc_getModel();
			var text=(dm&&this.$P.dmTextPath!=null)?dm.map(this.$P.dmPath,value,this.$P.dmTextPath):'';
			xlv.util.setElementValue(this,text);
		}
	}
};
